<?php

declare(strict_types=1);
/**
 * This file is part of MineAdmin.
 *
 * @link     https://www.mineadmin.com
 * @document https://doc.mineadmin.com
 * @contact  root@imoi.cn
 * @license  https://github.com/mineadmin/MineAdmin/blob/master/LICENSE
 */
use App\System\Middleware\WsAuthMiddleware;
use Hyperf\HttpServer\Router\Router;

Router::get('/', function () {
    return 'api';
});

Router::get('/favicon.ico', function () {
    return '';
});

// 消息ws服务器
//Router::addServer('message', function () {
//    Router::get('/message.io', 'App\System\Controller\ServerController', [
//        'middleware' => [WsAuthMiddleware::class],
//    ]);
//});

Router::addServer('message', function () {
    Router::get('/message.io', 'App\Chat\Controller\WebSocketController', [
        'middleware' => [\App\Chat\Middleware\WebSocketAuthMiddleware::class],
    ]);
});

Router::get('/callback/loginCallback/uid/{uid}/main_uid/{main_uid}/suc_jump/{suc_jump}/type/{type}',
    'App\CustHub\Controller\CallbackController@loginCallback',
    ['name' => 'login.callback'] // 路由命名
);

Router::get('/callback/pddLoginCallback/uid/{uid}/main_uid/{main_uid}/suc_jump/{suc_jump}/type/{type}',
    'App\CustHub\Controller\CallbackController@pddLoginCallback',
    ['name' => 'pdd.callback'] // 路由命名
);

Router::get('/callback/wphLoginCallback/uid/{uid}/main_uid/{main_uid}/suc_jump/{suc_jump}/type/{type}',
    'App\CustHub\Controller\CallbackController@wphLoginCallback',
    ['name' => 'wph.callback'] // 路由命名
);

Router::get('/callback/jdLoginCallback/uid/{uid}/main_uid/{main_uid}/suc_jump/{suc_jump}/type/{type}',
    'App\CustHub\Controller\CallbackController@jdLoginCallback',
    ['name' => 'wph.callback'] // 路由命名
);

